import time

from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
wd = webdriver.Chrome('C:\Program Files\Google\Chrome\Application\chromedriver.exe')
class XiangqingPage():
    sousuo = (By.ID, "keyword")
    shang = (By.XPATH,'//*[@id="compareForm"]/div/div[1]')
    web = 'http://192.168.153.135/'
    def Xiangqing(self,nei):
        wd.get(self.web)
        # time.sleep(1)
        wd.find_element(*self.sousuo).clear()
        # time.sleep(1)
        wd.find_element(*self.sousuo).send_keys(nei)
        wd.find_element(*self.sousuo).send_keys(Keys.ENTER)
        wd.find_element(*self.shang).click()
if __name__=='__main__':
    xiang=XiangqingPage()
    xiang.Xiangqing(nei="戒指")
